<html>
<head>
<title> Delete a staff for today</title>
<body>
<?php
if( isset( $_POST['staff_id'] ) ) {

	PutEnv("ORACLE_HOME=/usr/local/dbpackages/oracle");

	$c = oci_connect('comp231stu116', '47600210', 'comp231.cse.ust.hk');

	if(!$c) {
		echo "<p>Unable to connect:" . var_dump(oci_error($c));
		die();
	}

	$s1 = 'DELETE FROM FORM_1_TEAM FORM_2_TEAM WHERE STAFF_ID = ' . $_POST['staff_id'];
	$s2 = 'DELETE FROM DRIVER WHERE DRIVER_ID = ' . $_POST['staff_id'];
	$s3 = 'DELETE FROM NONDRIVER STAFF WHERE ID = ' . $_POST['staff_id'];
	
	
	
	
	$q1 = oci_parse($c, $s1);

	oci_execute($q1);
	$q2 = oci_parse($c, $s2);

	oci_execute($q2);
	$q3 = oci_parse($c, $s3);

	oci_execute($q3)

	//oci_fetch($q);
?>
	
	
<?php
	oci_close($c);

}
else {
?>
	<form method='POST'>
	Staff ID: <input name='staff_id' maxlength='5' />
	<button type='submit'>Delete</button>
	</form>

<?php
}
?>
</body>
<html>

